<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table>
        <tr>
            <td>biaoti</td>
            <td><input type="text" id=biaoti></td>
        </tr>
        <tr>
            <td>zhayao</td>
            <td><input type="text" id=zhayao></td>
        </tr>
        <tr>
            <td>neirong</td>
            <td><input type="text" id=neirong></td>
        </tr>
        <tr>
            <td>fenlei</td>
            <td><input type="text" id=fenlei></td>
        </tr>
        <tr>
            <td>zuozhe</td>
            <td><input type="text" id=zuozhe></td>
        </tr>
        <tr>
            <td>shijian</td>
            <td><input type="text" id=shijian></td>
        </tr>
        <tr>
            <td><input type="button" value="保存" onclick="Save()"></td>
            <td><input type="button" value="取消" onclick="Bark()"></td>
        </tr>
    </table>
    <script src="./js/jquery-3.6.0.min.js"></script>
    <script src="./js/init.js"></script>
    <script>
        $(function()
        {
            let id=window.location.href.split('=')[1]||''
            if(id)
            {
                $.get(`http://127.0.0.1:8080/product`,function(res)
                {
                    res.forEach(item => {
                        if(item.id==id)
                        {
                    $('[id=biaoti]').val(item.biaoti);
                    $('[id=zhayao]').val(item.zhayao);
                    $('[id=neirong]').val(item.neirong);
                    $('[id=fenlei]').val(item.fenlei);
                    $('[id=zuozhe]').val(item.zuozhe);
                    $('[id=shijian]').val(item.shijian);
                        }

                        
                    });

                })
            }

        })
    </script>
    
</body>
</html>